import requests


def save_file(filename, context):
    f = open(filename, mode='w', encoding='utf-8')
    f.write(context)
    f.close()


def get_html(url):
    payload = {
        'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) '
                      'Chrome/85.0.4183.121 Safari/537.36'}
    r = requests.get(url, payload)
    r.encoding = 'utf-8'

    return r.text


def main():
    html = get_html('http://www.pxc.jx.cn')
    save_file('萍乡学院.html', html)


main()
